from flask import Flask
from flask_restful import Api
from api.configs import config
from api.view import register_views
from api.view.login import login


def create_app(config_name=None):
    app = Flask(__name__)
    app.config.from_object(config)
    api = Api(app)
    register_views(api)

    return app